package com.hqyj.controller;

import com.hqyj.pojo.Setting;
import com.hqyj.service.SettingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;

@RequestMapping("/set")
@Controller
public class SettingController {
    @Autowired
    private SettingService settingService;
/*
访问setting页面的方法
 */
//访问settinglist页面的方法
@RequestMapping("/Setting_list")
public String Setting_list(){
    return "setting/Setting_list";
}
    /*
    查询设置
     */
    /*@RequestMapping(value = "/select1",method = RequestMethod.GET)
    @ResponseBody
    public Setting select1(){
        return settingService.selectByPrimaryKey();
    }*/

    @RequestMapping(value = "/select2",method = RequestMethod.GET)
    @ResponseBody
    public HashMap<String,Object> select2(){
        return settingService.selectAll();
    }
    /*
    修改设置
     */
    @RequestMapping(value = "/update1",method = RequestMethod.GET)
    @ResponseBody
    public HashMap<String,Object> update1(Setting s){
        return settingService.update(s);
    }
}
